package com.loren.designer.data.resp;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class ErrorResponse extends ResponseCode implements Serializable {

    private static final long serialVersionUID = -9076829633174742069L;

    /**
     * 系统异常编码
     */
    public static final String SYSTEM_ERROR_MESSAGE = "系统繁忙，请稍后再试！";

    private Integer code;

    private String message;

    public ErrorResponse(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static ErrorResponse failure(String message) {
        return new ErrorResponse(FAILURE_CODE, message);
    }
}
